package com.yigo.framework.http;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import javax.validation.Valid;
import java.util.*;

@Data
public class Q<T> {
    private Head head;
    @Valid
    private T params;

    @JsonIgnore
    public T getNonNullParams() {
        return Optional.ofNullable(params).orElseThrow(() -> new BException(RCodeEnum.PARAMS_NULL_ERROR, "params"));
    }
}
